package com.nuanshui.framework.res.qiniu;


import org.json.JSONException;
import org.json.JSONObject;

public class UpLoadFileVO  {

	private String id;
	private String url;//url地址
	private String name;//图片名字
	private String key;
	private Integer size;//图片大小
	private Integer width;//宽度
	private Integer height;//高度
	private String suffix;//前缀
	private String imageAve;//图片 ave值
	private String md5Code;

	public UpLoadFileVO(String response) throws JSONException {
		unmarshal(response);
	}

	private void unmarshal(String json) throws JSONException {
		JSONObject jsonObject = new JSONObject(json);

		if (jsonObject.has("key")) {
			this.key = jsonObject.optString("key");
		}
		if (jsonObject.has("name")) {
			this.name = jsonObject.optString("name");
		}
		if (jsonObject.has("size")) {
			this.size = jsonObject.optInt("size");
		}
		if (jsonObject.has("w")) {
			this.width = jsonObject.optInt("w");
		}
		if (jsonObject.has("h")) {
			this.height = jsonObject.optInt("h");
		}
		if (jsonObject.has("suffix")) {
			this.suffix = jsonObject.optString("suffix");
		}
		if (jsonObject.has("imageAve")) {
			this.imageAve = jsonObject.optString("imageAve");
		}
	}
	
	
	public String getMd5Code() {
		return md5Code;
	}

	public void setMd5Code(String md5Code) {
		this.md5Code = md5Code;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public Integer getSize() {
		return size;
	}

	public void setSize(Integer size) {
		this.size = size;
	}

	public Integer getWidth() {
		return width;
	}

	public void setWidth(Integer width) {
		this.width = width;
	}

	public Integer getHeight() {
		return height;
	}

	public void setHeight(Integer height) {
		this.height = height;
	}

	public String getSuffix() {
		return suffix;
	}

	public void setSuffix(String suffix) {
		this.suffix = suffix;
	}

	public String getImageAve() {
		return imageAve;
	}

	public void setImageAve(String imageAve) {
		this.imageAve = imageAve;
	}
	
	
}
